package cn.wolfcode.education.service.impl;

import cn.wolfcode.education.domain.Schedule;
import cn.wolfcode.education.mapper.ScheduleMapper;
import cn.wolfcode.education.query.ScheduleQuery;
import cn.wolfcode.education.service.IScheduleService;
import cn.wolfcode.education.util.PageResult;
import com.sun.rowset.internal.Row;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScheduleServiceImpl implements IScheduleService {
    @Autowired
    private ScheduleMapper scheduleMapper;
    public PageResult query(ScheduleQuery qo) {
        int total = scheduleMapper.queryForCount(qo);
        if(total == 0){
            return new PageResult();
        }
        List<Schedule> rows = scheduleMapper.queryForList(qo);
        return new PageResult(total,rows);
    }
}
